package com.AFH.test;

import android.graphics.Canvas;
import android.graphics.Rect;
//import android.graphics.Color;
//import android.graphics.Paint;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class AboutView extends SurfaceView implements SurfaceHolder.Callback{
	AboutViewThread avt;
	ViewSwitcher vs;
	Rect rect = new Rect(0,0,800,480);
	public AboutView(ViewSwitcher vs){
		super(vs);
		this.vs=vs;
		getHolder().addCallback(this);
		avt=new AboutViewThread(this,getHolder());
	}

	protected void doDraw(Canvas canvas) {
		BitmapManager.DrawbackgroundResource(0, canvas, 0, 0, null);
		BitmapManager.DrawbackgroundResource(3, canvas, 200, 40, null);
		
	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {
		// TODO Auto-generated method stub
		if(!avt.isAlive())
			avt.start();
		
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		// TODO Auto-generated method stub
		avt.flag=false;
		
	}
	public boolean gameTouch(int x, int y){
		if(rect.contains(x, y)){
			vs.AfhHandler.sendEmptyMessage(1);
		}
		return true;
	}

}
